package com.xysd.express.activity.mine.setting;

import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import com.xysd.express.R;
import com.xysd.express.activity.login.LoginActivity;
import com.xysd.express.base.BaseActivity;
import com.xysd.express.bean.User;
import com.xysd.express.util.ActivityTaskManeger;
import com.xysd.express.util.ToastUtil;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.ViewInject;

@ContentView(R.layout.activity_setting)
public class SettingActivity extends BaseActivity implements View.OnClickListener {

    @ViewInject(R.id.tel_layout)
    private LinearLayout tel_layout;
    @ViewInject(R.id.contact_layout)
    private LinearLayout contact_layout;
    @ViewInject(R.id.pay_layout)
    private LinearLayout pay_layout;
    @ViewInject(R.id.pwd_layout)
    private LinearLayout pwd_layout;
    @ViewInject(R.id.common_layout)
    private LinearLayout common_layout;
    @ViewInject(R.id.about_layout)
    private LinearLayout about_layout;
    @ViewInject(R.id.logout_btn)
    private Button logout_btn;
    @Override
    protected void init() {
        setTitleBar("设置");
        tel_layout.setOnClickListener(this);
        contact_layout.setOnClickListener(this);
        pay_layout.setOnClickListener(this);
        pwd_layout.setOnClickListener(this);
        common_layout.setOnClickListener(this);
        about_layout.setOnClickListener(this);
        logout_btn.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.tel_layout:
                startAty(BindMobileActivity.class);
                break;
            case R.id.contact_layout:
                ToastUtil.show("升级中");
                break;
            case R.id.pay_layout:
                startAty(PaySettingActivity.class);
                break;
            case R.id.pwd_layout:
                startAty(PayPwdSettingActivity.class);
                break;
            case R.id.common_layout:
                startAty(CommonSettingActivity.class);
                break;
            case R.id.about_layout:
                ToastUtil.show("升级中");
                break;
            case R.id.logout_btn:
                User.getInstance().cleanUser();
                ActivityTaskManeger.getInstance().closeAllActivity();
                startAty(LoginActivity.class);
                break;
        }
    }
}
